/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

//import com.facebook.proguard.annotations.DoNotStrip;
//
//@DoNotStrip
//todo enum &  DoNotStrip
export const enum YogaLogLevel {
  ERROR = 0,
  WARN = 1,
  INFO = 2,
  DEBUG = 3,
  VERBOSE = 4,
  FATAL = 5,
}


export function getYogaLogLevelFromInt(value: number): YogaLogLevel | never {
  switch (value) {
    case 0: return YogaLogLevel.ERROR;
    case 1: return YogaLogLevel.WARN;
    case 2: return YogaLogLevel.INFO;
    case 3: return YogaLogLevel.DEBUG;
    case 4: return YogaLogLevel.VERBOSE;
    case 5: return YogaLogLevel.FATAL;
    default: throw new Error("Unknown enum value: " + value);
  }
}

//
//export class YogaLogLevel {
//  public static readonly ERROR = 0
//  public static readonly WARN = 1
//  public static readonly INFO = 2
//  public static readonly DEBUG = 3
//  public static readonly VERBOSE = 4
//  public static readonly FATAL = 5
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaLogLevel.ERROR;
//      case 1: return YogaLogLevel.WARN;
//      case 2: return YogaLogLevel.INFO;
//      case 3: return YogaLogLevel.DEBUG;
//      case 4: return YogaLogLevel.VERBOSE;
//      case 5: return YogaLogLevel.FATAL;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
